Stripped PIR and Fingerprint code sections#3
Conversation
WalkthroughThis PR removes fingerprint and PIR sensor support (headers and implementations), updates micro-ROS APIs and calls to drop fingerprint/PIR data, and adds two new subscription callbacks for light and lidar. Changes
Sequence Diagram(s)sequenceDiagram
participant Main as main.cpp
participant MicroROS as microRosFunctions
participant ROS as ROS network
rect rgba(120,200,255,0.12)
Note left of Main: Data collection (fingerprint/PIR removed)
Main->>MicroROS: transmitMsg(thetaRef, omegaRef, usData, fanSpeeds, imuData)
MicroROS->>ROS: publish sensor message (US, Fans, IMU, refs)
ROS-->>MicroROS: incoming subscription msg (fan)
end
rect rgba(200,240,200,0.12)
Note left of MicroROS: New subscriptions
ROS-->>MicroROS: incoming subscription msg (light)
MicroROS->>Main: light_subscription_callback (static handler)
ROS-->>MicroROS: incoming subscription msg (lidar)
MicroROS->>Main: lidar_subscription_callback (static handler)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code graph analysis (2)MicrocontrollerCode/src/main.cpp (1)
MicrocontrollerCode/include/microRosFunctions.h (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
MicrocontrollerCode/include/microRosFunctions.h (1)
16-23: Remove stale parameter documentation.The comment at line 21 still references
@param fingerprintTopicNamewhich no longer exists in the function signature. This documentation should be removed to match the updated signature.Apply this diff:
#ifdef ROS /** * Sets up microROS communication * @param timerValue The transmission period * @param nodeName The name of the node * @param sensorTopicName The name of the topic - * @param fingerprintTopicName */ boolean microRosSetup(unsigned int timerValue, const char *nodeName, const char *sensorTopicName);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
MicrocontrollerCode/include/FingerprintFunctions.h(0 hunks)MicrocontrollerCode/include/PIRFunctions.h(0 hunks)MicrocontrollerCode/include/microRosFunctions.h(1 hunks)MicrocontrollerCode/src/FingerprintFunctions.cpp(0 hunks)MicrocontrollerCode/src/JoystickFunctions.cpp(1 hunks)MicrocontrollerCode/src/PIRFunctions.cpp(0 hunks)MicrocontrollerCode/src/main.cpp(2 hunks)MicrocontrollerCode/src/microRosFunctions.cpp(0 hunks)
💤 Files with no reviewable changes (5)
- MicrocontrollerCode/include/PIRFunctions.h
- MicrocontrollerCode/include/FingerprintFunctions.h
- MicrocontrollerCode/src/PIRFunctions.cpp
- MicrocontrollerCode/src/microRosFunctions.cpp
- MicrocontrollerCode/src/FingerprintFunctions.cpp
🧰 Additional context used
🧬 Code graph analysis (2)
MicrocontrollerCode/src/main.cpp (1)
MicrocontrollerCode/src/microRosFunctions.cpp (6)
publishError(318-325)publishError(318-318)transmitMsg(353-382)transmitMsg(353-353)transmitMsg(388-395)transmitMsg(388-388)
MicrocontrollerCode/include/microRosFunctions.h (1)
MicrocontrollerCode/src/microRosFunctions.cpp (8)
microRosSetup(224-315)microRosSetup(224-224)transmitMsg(353-382)transmitMsg(353-353)transmitMsg(388-395)transmitMsg(388-388)publishError(318-325)publishError(318-318)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (4)
MicrocontrollerCode/include/microRosFunctions.h (1)
35-39: LGTM!The static subscription callback declarations are correctly defined with appropriate signatures for ROS subscription handlers.
MicrocontrollerCode/src/main.cpp (3)
79-82: LGTM!The error status output correctly reflects the removal of fingerprint sensor functionality while maintaining debug visibility for the remaining sensors.
118-118: Verify transmitMsg implementation is updated.This call to
transmitMsgomits thePIRSensorsparameter, matching the updated header signature inmicroRosFunctions.h. However, if the implementation inmicroRosFunctions.cppwasn't updated (as suggested by the code snippets at lines 352-381), this will cause a linker error.The verification script in the earlier comment on
microRosFunctions.hline 31 will confirm whether the implementation matches.
120-123: LGTM with note.This call to
publishErrorcorrectly uses 3 arguments matching the updated function signature inmicroRosFunctions.hline 33. Note that line 73 in this same file incorrectly passes 4 arguments to the same function, which needs to be fixed.
Summary by CodeRabbit